<?php

class Setting_model extends CI_Model {

    var $key_option   = '';
    var $value_option = '';
    
    public function __construct() {
        parent::__construct();
    }

    public function set_value($key, $value) {
        $this->key_option = $key;
        $this->value_option = $value;
        $this->db->update('setting', $this, array('key_option' => $key));
    }
    public function get_value($key) {
        $this->key_option = $key;
        
        $query = $this->db->get_where('setting', array('key_option' => $key), 1, 1);
//        var_dump($query->result());
//        exit();
        return $query->result();
    }
}
